package com.allwees.core.wf.event.listener;

import com.allwees.core.mq.rabbitmq.MqUtil;
import com.allwees.core.wf.Action;
import com.allwees.core.wf.event.WfActionEvent;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionalEventListener;

/**
 *
 *
 * @author yangylsky
 * @since 2019-12-11
 *
 */
@Component
public class WfActionListener {
	@Async
	@TransactionalEventListener
	public <A extends Action> void onEvent(WfActionEvent<A> event) {
		MqUtil.send(event);
	}
}
